package com.caipiao.task;

import com.caipiao.mapper.SPlanMapper;
import com.caipiao.service.PlanService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Controller;

/**
 * Created by Administrator on 2019/3/13.
 */
@Controller
public class task {

    private static final Logger LOG = LoggerFactory.getLogger(task.class);

    @Autowired
    private PlanService planService;

    /**
     * 定时推送比赛信息
     */
    @Scheduled(cron = "0 0/15 * * * ?")//每15分钟执行
    public void taskPlanItem() {
        LOG.info("------------比赛信息推送定时任务开始----------------");
        planService.jpush();
        LOG.info("------------比赛信息推送定时任务结束----------------");
    }
}
